import './assets/main.css'
import {createApp} from 'vue'
import '@assets/ele-customer.scss'
import ElementPlus from 'element-plus'
//element-plus使用语言
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

zhCn.el.pagination.total = "共{total} 条"
zhCn.el.pagination.goto = "跳至"
zhCn.el.pagination.pagesize = "条/页"
zhCn.el.pagination.pageClassifier = "页"
import App from './App.vue'
import router from './router'
import pinia from '@stores/index'
import VConsole from "vconsole";
import numTool from "@utils/num-tool";

// import function to register Swiper custom elements
import {register} from 'swiper/element/bundle';
// register Swiper custom elements
register();
Array.prototype['random'] = function () {
    return this[Math.floor((Math.random() * this.length))];
}
//根组件
const app = createApp(App)
//创建vConsole面板, 用于调试
// new VConsole()
app.use(pinia)
app.use(router.router)
//加载element-plus
app.use(ElementPlus, {locale: zhCn})
//注册element-plus icon组件
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
app.mount('#app')
app.config.errorHandler = (err) => {
    console.log("全局错误:", err)
}
//全局挂载
app.config.globalProperties.$numTool = numTool

import duration from 'dayjs/plugin/duration'
import weekday from 'dayjs/plugin/weekday'
import dayjs from "dayjs";

dayjs.extend(duration)
dayjs.extend(weekday)



